<div class="row">
  <div class="col-md-6 col-sm-8 col-sm-push-2">
    <form class="form form-horizontal" [formGroup]="channelsForm">
      <div class="one-form-header"></div>
      <div class="one-form-body">
        <div class="form-group">
          <label for="channel_add_channelName" class="col-sm-4 control-label">通道名称:</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="通道名称" id="channel_add_channelName"
                   required formControlName="alarmName">
            <div *ngIf="formErrors.alarmName" class="has-error">
              <label class="control-label"><i class="fa fa-times-circle-o"></i>{{formErrors.alarmName}} </label>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label for="channel_add_receiverName" class="col-sm-4 control-label">发送对象:</label>
          <div class="col-sm-8">
            <input type="hidden" class="form-control" id="channel_add_receiver"
                   formControlName="receiver" >
            <input type="text" class="form-control" id="channel_add_receiverName" placeholder="鼠标双击选择发送对象"
                   formControlName="receiverName"(dblclick) ="getReceiver()" readonly>
            <div *ngIf="formErrors.receiver" class="has-error">
              <label class="control-label"><i class="fa fa-times-circle-o"></i>{{formErrors.receiver}} </label>
            </div>
          </div>
        </div>

        <div class="row">
          <label class="col-sm-4 control-label">报警类型:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_national" value="1" checked formControlName="type">
                <label for="channel_add_type_national">
                  标准站
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_small" value="2" formControlName="type">
                <label for="channel_add_type_small">
                  微型站
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_industry" value="3" formControlName="type">
                <label for="channel_add_type_industry">
                  工业废气
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_raiseDust" value="4" formControlName="type">
                <label for="channel_add_type_raiseDust">
                  扬尘
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_lampblack" value="5" formControlName="type">
                <label for="channel_add_type_lampblack">
                  油烟
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_sprayBooth" value="6" formControlName="type">
                <label for="channel_add_type_sprayBooth">
                  喷漆房
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_gasStation" value="7" formControlName="type">
                <label for="channel_add_type_gasStation">
                  加油站
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_waterPollution" value="8" formControlName="type">
                <label for="channel_add_type_waterPollution">
                  工业废水
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_type_waterSurface" value="9" formControlName="type">
                <label for="channel_add_type_waterSurface">
                  水质断面
                </label>
              </div>

            </div>
          </div>
        </div>

        <div class="row">
          <label class="col-sm-4 control-label">报警等级:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-3">
                <input type="radio" id="channel_add_level_blue" value="1" checked
                       formControlName="level">
                <label for="channel_add_level_blue">
                  蓝色
                </label>
              </div>
              <div class="col-xs-3">
                <input type="radio" id="channel_add_level_yellow" value="2" formControlName="level">
                <label for="channel_add_level_yellow">
                  黄色
                </label>
              </div>
              <div class="col-xs-3">
                <input type="radio" id="channel_add_level_orange" value="3" formControlName="level">
                <label for="channel_add_level_orange">
                  橙色
                </label>
              </div>
              <div class="col-xs-3">
                <input type="radio" id="channel_add_level_red" value="4" formControlName="level">
                <label for="channel_add_level_red">
                  红色
                </label>
              </div>
            </div>
          </div>
        </div>

        <div class="row">
          <label class="col-sm-4 control-label">发送方式:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-4">
                <input type="radio" id="channel_add_sendMode_inApp" value="1" checked
                       formControlName="sendMode">
                <label for="channel_add_sendMode_inApp">
                  应用内
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_sendMode_SMS" value="2" formControlName="sendMode">
                <label for="channel_add_sendMode_SMS">
                  短信
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_sendMode_email" value="3"
                       formControlName="sendMode">
                <label for="channel_add_sendMode_email">
                  邮件
                </label>
              </div>
            </div>
          </div>
        </div>

        <div class="row">
          <label class="col-sm-4 control-label">实时发送:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-4">
                <input type="radio" id="channel_add_isReal_yes" value="1" checked
                       formControlName="isReal" (click)="yesClickFun($event)">
                <label for="channel_add_isReal_yes">
                  是
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_isReal_no" value="0" formControlName="isReal"
                       (click)="noClickFun($event)">
                <label for="channel_add_isReal_no">
                  否
                </label>
              </div>
            </div>
          </div>
        </div>

        <div class="form-group" id="channel_add_startTime_div" style="display: none;">
          <label for="channel_add_startTime" class="col-sm-4 control-label">开始时间:</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="开始时间" id="channel_add_startTime"
                   formControlName="startTime">
          </div>
        </div>

        <div class="form-group" id="channel_add_endTime_div" style="display: none;">
          <label for="channel_add_endTime" class="col-sm-4 control-label">结束时间:</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="结束时间" id="channel_add_endTime"
                   formControlName="endTime">
          </div>
        </div>

        <div class="row">
          <label class="col-sm-4 control-label">是否有效:</label>
          <div class="col-sm-8">
            <div class="row">
              <div class="col-xs-4">
                <input type="radio" id="channel_add_Use" value="1" formControlName="isUse">
                <label for="channel_add_Use">
                  有效
                </label>
              </div>
              <div class="col-xs-4">
                <input type="radio" id="channel_add_inUse" value="0" checked formControlName="isUse">
                <label for="channel_add_inUse">
                  无效
                </label>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="one-form-footer">
        <div class="pull-right">
          <button class="btn btn-default" type="reset" (click)="cancelChannelAdd()">取消</button>
          <button class="btn btn-success" type="button" [disabled]="channelsForm.invalid" (click)="onSubmit()">提交
          </button>
        </div>
      </div>
    </form>
  </div>
</div>
